#include "../inc/hart_master_frame.h"

hart_master_attribute_t hart_master_attribute; // 主机属性

static BOOL has_mock = FALSE; // 测试使用该变量判断是否重入
void mock_master_attribute(void)
{
    if (TRUE == has_mock)
    {
        return;
    }
    io_system_device_t *device = &hart_master_attribute.io_system.cards[0].channels[0].devices[0];
    device->identifier = 0xA001;
    device->online = TRUE;
    device->extended_device_type = EXTENDED_DEVICE_TYPE_LAPOOL;
    ;
    device->m2s_preambles_limit_count = HART_PREAMBLE_DEFAULT_LEN;
    device->hart_revision = HART_PROTOCOL_VERSION_7;
    device->device_revision = 1;
    device->device_software_revision = 1;
    device->device_hardware_revision.bits.hardware_revision = 1;
    device->device_hardware_revision.bits.physical_signaling_code = PHYSICAL_SIGNALS_2;
    device->device_id[0] = 0x01;
    device->device_id[1] = 0x02;
    device->device_id[2] = 0x03;
    device->s2m_preambles = HART_PREAMBLE_DEFAULT_LEN;
    device->last_device_variable = DEVICE_VARIABLE_CODE_246;
    device->configuration_update_count = 2;
    device->extended_device_status = EXTENDED_DEVICE_STATUS_1;
    device->manufacturer_identification_code = MANUFACTURER_IDENTIFIER_ACROMAG;
    device->private_label_distributor_code = MANUFACTURER_IDENTIFIER_ACROMAG;
    device->device_profile = DEVICE_CONFIGURATION_FILE_CODE_68;
}
